#ifndef H_ITEMPARSER
#define H_ITEMPARSER
#include "precompiled.h"
#include "itemdatabase.h"
#include "character.h"
#include "item.h"
namespace weo
{
    namespace engine
    {
        namespace item
        {
            class Itemparser
            {
            private:
                Itemdatabase *m_Itemdb;
                std::map<std::string,int> m_Armortype;
                std::map<std::string,int> m_Weapontype;
                std::map<std::string,std::string> m_SpecialMatch;
                std::vector<std::vector<std::string>> m_AttrSplit;
                boost::regex *m_IncExpression;
                boost::regex *m_Valuefirst;
                boost::regex *m_Valuelast;
                boost::regex *m_KeyExpression;			
                boost::regex *m_ArmorPenetration;
                std::string m_Currentfile;
                void parseExtraFile(weo::engine::item::Item& item);
                size_t hashString(const std::string& value) const ;
                float specialValue(const std::string& value) const ;
            public:
                void parseFiles();
                std::vector<weo::engine::item::Attribute> parseDescription(std::string desc);
                std::string genericPartialAttributeMatcher(std::string bonus);
                std::string specialMatcher(std::string bonus);
                Itemparser(Itemdatabase *db);
                boost::tuple<int,int,int> calcTypes(int type, std::string subtype = "");
            };
        };
    };
};
#endif